<?php

// File : show_text.php
    
include_once("html_utilities.php");
include_once("random_text_generator.php");

// Read user input
$length = $_REQUEST[LENGTH_KEY];
$paragraph_length = $_REQUEST[PARAGRAPH_LENGTH_KEY];
$language = $_REQUEST[LANGUAGE_NAME_KEY];

// Construct a RandomTextGenerator object, that does the real work.
$rtg = new RandomTextGenerator($language, LANGUAGE_LIST_FILE);

// Display the results
echo get_html_start(TITLE, STYLESHEET);
echo "<h1>Here are $length sentences of random text in $language:</h1><br />";
echo "<p>" . $rtg->get_random_text($length, $paragraph_length) . "</p>"; 
echo get_html_end();

?>